import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)


import createPersistedState from "vuex-persistedstate"
export default new Vuex.Store({
  state: {
    allCode:0,
    undealedNum:0,
    // percentage:0,
    loginData:null
  },
  mutations: {
    // changePer (state, n) {
    //   state.percentage = n
    // },
    changeAllCodeNum(state,n){
      state.allCode = n
    },
    changeUndoNum(state,n){
      state.undealedNum = n;
    },
    setLogin (state, n) {
      state.loginData = n
    }
  },
  actions: {

  },
  plugins: [createPersistedState({
    storage: window.sessionStorage
})]
})
